
<script>
	var url;
	$(document).ready(function(){
		
		caption_produk = function(value, row, index){
			if(row.isparent){
				return 'Produk : '+value;
			}else{
				return value;
			}
		}
		
	});
</script>

<form name="form1" id="form1" method="post">
	<input name="ID_KPS" type="hidden" value="<?php echo $ID_KPS;?>">
	<input name="TAHUN" type="hidden" value="<?php echo $TAHUN;?>">
	<input name="BULAN" type="hidden" value="<?php echo $BULAN;?>">
</form>
<table id="dg-realisasi" title="<?=''.$NAMA_KPS.'| Tahun '.$TAHUN.'| Bulan '.$BULAN?>" class="easyui-treegrid" autoRowHeight="false" fit="true" IdField="id" treeField="NM_PROD" url="<?=base_url().'realisasi_kkks/grid_detail/'.$ID_KPS.'/'.$TAHUN.'/'.$BULAN;?>" showFooter="true">
	<thead frozen="true"> 
		<tr>
			<th field="NM_PROD" align="left" width="200" formatter="caption_produk">WILAYAH</th>
		</tr>
	</thead>
	<thead > 
		<tr>
			<th>Minyak Bumi</th>
			<th colspan="3">Gas Bumi</</th>
			<th>Harga Satuan</th>
			<th>Lifting Premium</th>
			<th>Premium</th>
			<th>Gross Revenue</th>
			<th>Net Back</th>
			
		</tr>
		<tr>
			<th data-options="field:'a', width:100, align:'right', halign:'center', formatter:formatPrice">BAREL</th>
			<th data-options="field:'b', width:100, align:'right', halign:'center', formatter:formatPrice">MMBTU</th>
			<th data-options="field:'c', width:100, align:'right', halign:'center', formatter:formatPrice">MSCF</th>
			<th data-options="field:'d', width:100, align:'right', halign:'center', formatter:formatPrice">MT</th>
			<th data-options="field:'e', width:100, align:'right', halign:'center', formatter:formatPrice">US$</th>
			<th data-options="field:'f', width:100, align:'right', halign:'center', formatter:formatPrice">BAREL</th>
			<th data-options="field:'g', width:100, align:'right', halign:'center', formatter:formatPrice">US$</th>
			<th data-options="field:'h', width:100, align:'right', halign:'center', formatter:formatPrice">US$</th>
			<th data-options="field:'i', width:100, align:'right', halign:'center', formatter:formatPrice">US$</th>

		</tr>
		
	</thead>
</table>

	<script>
	function formatPrice(val,row){
		return accounting.formatMoney(val, "", 2, ".", ",");
	}
	</script>

